package com.jph.simple;

import java.util.Comparator;

import model.Friend;

/**
 * Created by xueal on 2018/1/18.
 */


public class SortFriendByOnline implements Comparator {
    public int compare(Object o1, Object o2) {
        Friend s1 = (Friend) o1;
        Friend s2 = (Friend) o2;
//            return s1.getOnline().compareTo(s2.getOnline());
        if (Friend.check(s1.getOnline()) > Friend.check(s2.getOnline()))
            return -1;
        return 1;
    }
}